<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
</head>

<body>
    <script type="text/javascript">
        // 输入：'font-size'
        // 输出：fontSize
        //  -webkit-border-image 转换后的结果为 webkitBorderImage
        // 核心思路就是把字符串的每个字符挨个处理，判断它是否应该大写，然后扔到数组里，最后做一个数组join即可
        function cssStyle2DomStyle(sName) {
            const resultArr = [];
            let nextShouldUp = false;
            for(let i = 0; i < sName.length; i ++) {
                if(sName[i] === '-') {
                    nextShouldUp = i !== 0 ? true : false;
                    continue;
                }
                resultArr.push(nextShouldUp ? sName[i].toUpperCase() : sName[i]);
                nextShouldUp = false;
            }
            return resultArr.join("");
		}
    </script>
</body>

</html>